package com.jiaai.cloud.base.entity;

import com.fasterxml.jackson.annotation.JsonInclude;

public class RestResult<T> {

    private boolean result;
    private int code;
    private String message;
    private String description;
    private T data;

    private RestResult() {}

    public static <T> RestResult<T> newInstance() {
        return new RestResult<T>();
    }

    // ...setter and getter

    @Override
    public String toString() {
        return "RestResult{" +
                "result=" + result +
                ", code='" + code + '\'' +
                ", message='" + message + '\'' +
                 ", description='" + description + '\'' +
                ", data=" + data +
                '}';
    }

    @JsonInclude(JsonInclude.Include.NON_NULL)
	public boolean isResult() {
		return result;
	}

	public void setResult(boolean result) {
		this.result = result;
	}
	@JsonInclude(JsonInclude.Include.NON_NULL)
	public String getMessage() {
		return message;
	}

	public void setMessage(String message) {
		this.message = message;
	}
	@JsonInclude(JsonInclude.Include.NON_NULL)
	public T getData() {
		return data;
	}

	public void setData(T data) {
		this.data = data;
	}
	@JsonInclude(JsonInclude.Include.NON_NULL)
	public String getDescription() {
		return description;
	}

	public void setDescription(String description) {
		this.description = description;
	}
	@JsonInclude(JsonInclude.Include.NON_NULL)
	public int getCode() {
		return code;
	}

	public void setCode(int code) {
		this.code = code;
	}
	
    
}